<template>
    <el-dialog v-model="visible" :destroy-on-close="true" :width="1100" top="5" :title="state.title">
        <DictValue :code="state.code"/>
    </el-dialog>
</template>

<script setup lang="ts" name="DictValueDialog">

import { reactive, ref } from 'vue';
import { ElMessage } from "element-plus";
import DictValue from "/@/views/system/dictValue/index.vue";
// drawer框状态
const visible = ref(false);

const state = reactive({
    code: '',
    title: ''
});

// 接收父组件传过来的参数
const acceptParams = async (params: any) => {
    state.code = params.code
    state.title = params.title + '-' + params.code;

    if(!params.code) {
        ElMessage.error('获取字典信息失败')
        return;
    }

    visible.value = true
};

defineExpose({
    acceptParams
});
</script>
